package com.train.daily.api;

import com.train.common.resp.CommonResp;
import com.train.daily.dto.seat.DailyTrainSeatQueryListDTO;
import com.train.daily.dto.seat.DailyTrainSeatEditChoiceSeatDTO;
import com.train.daily.resp.seat.DailyTrainSeatQueryListResp;
import com.train.daily.service.DailyTrainSeatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class DailyTrainSeatApiImpl implements DailyTrainSeatApi {

    @Autowired
    private DailyTrainSeatService dailyTrainSeatService;

    @Override
    public CommonResp queryTrainSeatList(DailyTrainSeatQueryListDTO dto) {
        List<DailyTrainSeatQueryListResp> queryListRespList = dailyTrainSeatService.queryTrainSeatList(dto);
        return CommonResp.ok(queryListRespList);
    }

    @Override
    public CommonResp batchEditDailyTrainSeat(List<DailyTrainSeatEditChoiceSeatDTO> dto) {
        dailyTrainSeatService.batchEditDailyTrainSeat(dto);
        return CommonResp.ok();
    }
}
